package com.bw.member.view

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.blankj.utilcode.util.ToastUtils
import com.bw.base.constants.RoutePath
import com.bw.common.view.BaseMvvmActivity
import com.bw.member.adapter.MemberAdapter
import com.bw.member.databinding.ActivityMemberBinding
import com.bw.member.entity.MemberEntity
import com.bw.member.net.MemberViewModel

/**
 * 智慧园区-月卡会员管理
 * 月卡
 * 刘哲甫
 * 20250509
 */
@Route(path = RoutePath.PATH_MEMBER)
class MemberActivity : BaseMvvmActivity<ActivityMemberBinding,MemberViewModel>() {

    private lateinit var memberAdapter : MemberAdapter
    private lateinit var memberEntity: MemberEntity

    override fun initView() {
        memberEntity = MemberEntity()

        binding.topBar.ivBack.setOnClickListener { finish() }
        binding.topBar.tvTitle.text = "月卡"


    }

    override fun initData() {
        vm.memberSuccess.observe(this){
            memberEntity = it

            binding.vip.setText(it.membershipLevel)
            binding.ri.text = it.registrationDate+" 到期"
        }

    }

    override fun onResume() {
        super.onResume()
        //后期改成uid
        vm.getMember(437)
    }

}